<extend name="Public:innerbase" />
<block name="css">
<link rel="stylesheet" href="{:STATICS}/validation/css/validationEngine.jquery.css" />
<link type="text/css" rel="stylesheet" href="{:STATICS}/datetimepicker/css/bootstrap-datetimepicker.min.css" />
</block>
<block name="js">
<include file="Public:upload" />
<include file="Public:editor" />
<script type="text/javascript" src="{:STATICS}/validation/js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="{:STATICS}/validation/js/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="{:STATICS}/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="{:STATICS}/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
$(function(){
	$("#editForm").validationEngine("attach",{ 
		promptPosition:"centerRight",
		scroll:true,
		showOneMessage:true
	});
	$(".input-date").datetimepicker({format: 'yyyy-mm-dd hh:ii',language:'zh-CN',minView:0,autoclose:true});
});
</script>
</block>
<block name="content">
<div class="container-fluid">
	<div class="page-header wm-page-header">
		<h4>活动信息</h4>
		<a href="{:U('Zaojiao/zj_activity')}" class="btn btn-default btn-sm">
			<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;返回
		</a>
	</div>
	<form id="editForm" class="form-horizontal" method="post">
		<input type="hidden" name="id" value="{$set.id}" />
		<div class="form-group">
			<label class="col-sm-2">活动名称</label>
			<div class="col-md-2">
				<input type="text" name="title" value="{$set.title}" class="form-control validate[required,minSize[2]]" />
				<span class="help-block">不要超过8个字符</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">开始时间</label>
			<div class="col-md-2">
				<input type="text" id="start_time" name="start_time" value="{$set.start_time|default=time()|date='Y-m-d H:i',###}" class="input-date form-control" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">结束时间</label>
			<div class="col-md-2">
				<input type="text" id="end_time" name="end_time" value="{$set.end_time|default=(time()+5*86400)|date='Y-m-d H:i',###}" class="input-date form-control" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">报名截止时间</label>
			<div class="col-md-2">
				<input type="text" id="sign_stop_time" name="sign_stop_time" value="{$set.sign_stop_time|default=(time()+86400)|date='Y-m-d H:i',###}" class="input-date form-control" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">活动图片</label>
			<div class="col-sm-6" >
				<input type="hidden" class="form-control" value="{$set.img}" id="img" name="img" />
				<img id="imgHolder" style="width:216px;" class="" <if condition="$set['img'] eq ''">src="{:RES}/images/photo/noneimg.jpg"</if> src="{$set.img}"/>
				<div class="btn-group" style="vertical-align:bottom;">
					<span class="btn btn-xs btn-primary" onclick="selectAsset('img')">
						<span class="glyphicon glyphicon-cloud-upload"></span>选择
					</span>
					<span class="btn btn-primary btn-xs" onclick="previewImg('img')">
						<span class="glyphicon glyphicon-picture"></span>预览
					</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">活动简介</label>
			<div class="col-md-4">
				<textarea id="intro" rows="5" name="intro" class="form-control">{$set.intro}</textarea>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">活动详情</label>
			<div class="col-md-6">
				<textarea class="form-control" name="detail" id="content" rows="5" style="height:260px">{$set.detail|htmlspecialchars_decode}</textarea>
			</div>
		</div>
		<div class="form-group">
            <label class="col-sm-2">排序</label>
            <div class="col-md-2">
                <input type="text" id="sort" name="sort" value="{$set.sort|default=1}" class="form-control validate[required,custom[integer],min[1],max[255]" />
                <span class="help-block">范围1-255，越小越靠前</span>
            </div>
        </div>
		<div class="form-group">
			<div class="col-md-5 col-sm-offset-2">
				<input type="submit" class="btn btn-primary" value="保存" />
			</div>
		</div>
	</form>
</div>
</block>